package com.circle.rest.modular.qrtz.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 定时任务
 * </p>
 *
 * @author 赵航
 * @since 2019-04-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("qrtz_task")
@ApiModel(value = "Task对象", description = "定时任务")
public class Task implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "编号")
    @TableId(value = "id", type = IdType.UUID)
    private String id;

    @ApiModelProperty(value = "Job引用路径")
    private String jobReference;

    @ApiModelProperty(value = "任务名称")
    private String name;

    @ApiModelProperty(value = "执行频率")
    private String cron;

    @ApiModelProperty(value = "任务开始时间")
    private Date startTime;

    @ApiModelProperty(value = "任务结束时间")
    private Date endTime;

    @ApiModelProperty(value = "执行间隔时间(s)")
    private Integer intervalInSeconds;

    @ApiModelProperty(value = "执行次数")
    private Integer triggerRepeatCount;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "删除状态")
    @TableLogic
    private Integer deleteState;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "最后更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;


}
